CREATE TABLE BABEL_3478_t1 (
    ID INT PRIMARY KEY IDENTITY(1,1),
    FirstName VARCHAR(50),
    LastName VARCHAR(50),
    Salary MONEY
);
GO
-- Inserting data into the BABEL_3478_t1 table
INSERT INTO BABEL_3478_t1 (FirstName, LastName, Salary)
VALUES ('John', 'Doe', 50000),
       ('Jane', 'Doe', 60000), 
       ('Jim', 'Smith', 55000),
       ('Sarah', 'Johnson', 65000),
       ('David', 'Lee', 70000),
       ('Jennifer', 'Garcia', 55000);
GO


CREATE VIEW BABEL_3478_t1_InfoView AS
SELECT ROWCOUNT_BIG()
FROM BABEL_3478_t1;
GO

CREATE PROCEDURE Insert_BABEL_3478_p1
AS
BEGIN
    -- Inserting data into the BABEL_3478_t1 table
    INSERT INTO BABEL_3478_t1 (FirstName, LastName, Salary)
    VALUES ('Dwayne', 'Johnson', 90000000), ('Chris', 'Jericho', 4000000), ('Jhon', 'Chena', 55000);
    SELECT ROWCOUNT_BIG()
END;
GO


CREATE VIEW Updated_BABEL_3478_InfoView AS
SELECT ROWCOUNT_BIG()
FROM BABEL_3478_t1
WHERE LastName = 'Doe';
GO

CREATE PROCEDURE Update_BABEL_3478_Salary
    @LastName VARCHAR(50),
    @NewSalary MONEY
AS
BEGIN
    UPDATE BABEL_3478_t1
    SET Salary = @NewSalary 
    WHERE LastName = @LastName;
    SELECT ROWCOUNT_BIG()
END
GO


CREATE PROCEDURE Delete_BABEL_3478_p2
  @LastName VARCHAR(50)
AS
BEGIN
  DELETE FROM BABEL_3478_t1 WHERE LastName = @LastName;
  SELECT ROWCOUNT_BIG()
END;
GO
